package d0312;
//匿名内部类
public class AnonymousInnerClass {
    private String name="Jerry";
    private int age=24;
    IFoo foo=new IFoo() {
        @Override
        public void display() {
            System.out.println(name+"  "+age);
        }
    };

    public static void main(String[] args) {
        AnonymousInnerClass anonymousInnerClass=new AnonymousInnerClass();
        anonymousInnerClass.foo.display();
    }
}


interface IFoo{
    public void display();
}